/*
 * Main.java
 *  java program model for www.programming-challenges.com
 */

import java.io.*;

public class Main implements Runnable{
	/* utility function to read from stdin,
	   Provided by Programming-challenges, edit for style only */
	static String ReadLn(int maxLength){  
		byte line[] = new byte [maxLength];
		int length = 0;
		int input = -1;
		try{
			/* Read until maxLength or until end of line input */
			while (length < maxLength){
				input = System.in.read();
				if ((input < 0) || (input == '\n')) break; 
				line [length++] += input;
			}

			if ((input < 0) && (length == 0)) return null;  // eof
			return new String(line, 0, length);
		}catch (IOException e){
			return null;
		}
	}
	
	/* utility function to get clean String by mcjung */
	static final private String REGEX_WHITESPACE = "\\s+";	
	static String getCleanLine(String dirtyLine) {
		return dirtyLine.trim().replaceAll(REGEX_WHITESPACE, " ");
	}

	public static void main(String args[])  // entry point from OS
	{
		Main myWork = new Main();  // Construct the bootloader
		myWork.run();            // execute
	}

	public void run() {
		new myStuff().run();
	}
}

class myStuff implements Runnable{
	static final private int readLength = 255;	

	public void run(){
		while(true) {
			String input = Main.ReadLn(readLength);			
			if(input == null) break;

			String cleanLine = Main.getCleanLine(input);

			// Your program here
		}

	}

	// You can insert more classes here if you want.
}

